import {ref} from "vue"
import _ from "lodash"

export default function useResizeDom(pageData:any){
    const dom1 = ref()
    const dom2 = ref()
    const resizeWin = _.debounce(() => {
        if (dom2.value) {
          const height = dom2.value.$el.offsetHeight - dom1.value.offsetHeight - 70;
          pageData.tableHeight = height;
        }
      }, 200)
      const nextResize=()=>{ 
        if (dom2.value) {
            const height = dom2.value.$el.offsetHeight - dom1.value.offsetHeight - 70;
            pageData.tableHeight = height;
            console.log(height);
          }
      }
    return{
        dom1,dom2,resizeWin,nextResize
    }
}